var xh;
var sname;
function checkuser()
{    
    if(window.ActiveXObject)
    {      
        xh=new ActiveXObject("Microsoft.XMLHTTP");	 
    }
    else if(window.XMLHttpRequest)
    {
        xh=new XMLHttpRequest();	
    }
	  
    sname=document.getElementById("username").value;  
    xh.onreadystatechange=connection;
    xh.open("get" , "./ajax?username="+sname , true);
    xh.send();	 
}  
function connection()
{   
    if(xh.readyState==4)
    {      
            document.getElementById("id1").innerHTML=xh.responseText;        
    }
}
  
 